package com.william.jdbcplus.test.entity;

import com.william.jdbcplus.common.annotation.*;
import com.william.jdbcplus.common.entity.Entity;
import com.william.jdbcplus.common.enums.IdType;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@Table("db_role_menu")
@ApiModel("用户菜单关联表")
@TableUks({
        @TableUk(fields = {"roleId", "menuId"})
})
public class DbRoleMenu implements Entity {
    @TableId(type = IdType.GUID)
    private String id;

    @TableColumn(remarks = "角色id", nullable = false)
    @TableFk(pkEntity = DbRole.class, pkField = "id")
    private String roleId;

    @TableColumn(remarks = "菜单id", nullable = false)
    @TableFk(pkEntity = DbMenu.class, pkField = "id")
    private String menuId;
}
